﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Moral_Teacher_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>德育评价系统</title>
    <link type="text/css" rel="stylesheet" href="../Common/css/main.css" />
    <script type="text/javascript" src="../Common/Js/jquery.js"></script>
    <script type="text/javascript" src="../Common/Js/common.js"></script>
    <script type="text/javascript" src="../Common/Js/msg.js"></script>
    <script language="javascript">
    var  canUseManage = false;

    var  canUseInput = false;
    
    var  canStart = false;
    function Navigate(itemIndex)
    {
        
        switch(itemIndex)
        {
            case 1://德育规则设置
                if(canUseManage)
                {
                    document.getElementById("div2").style.marginLeft="200px";
                    document.getElementById("div1").style.display="inline";

                    frames["leftFrame"].location.href="RuleSettings/newLeft.aspx";
                    frames["mainFrame"].location.href="about:blank";
                }
                else
                {
                    showMassgeBox("提示","您没有权限进行设置！",1,null);
                    return ;
                }
            break;
//            case 2://德育日常管理
////                if(canStart)
////                {
//                    document.getElementById("div2").style.marginLeft="200px";
//                    document.getElementById("div1").style.display="inline";

//                    frames["leftFrame"].location.href="DailyManage/Left.aspx";
//                    frames["mainFrame"].location.href="DailyManage/Daily.aspx";
////                }
////                else
////                {
////                    showMassgeBox("提示","评估规则没有确定，无法进行评估管理！",1,null);
////                    return ;
////                }
//            break;
            case 3://德育评分录入
//                if(canStart)
//                {
                    document.getElementById("div2").style.marginLeft="200px";
                    document.getElementById("div1").style.display="inline";

                    frames["leftFrame"].location.href="ScoreInput/Left.aspx";
                    //frames["mainFrame"].location.href="ScoreInput/Overview.aspx";
//                }
//                else
//                {
//                    showMassgeBox("提示","评估规则没有确定，评价录入！",1,null);
//                    return ;
//                }
               
            break;
            case 4: //德育报表查询
//                if(canStart)
//                {
                    document.getElementById("div2").style.marginLeft="200px";
                    document.getElementById("div1").style.display="inline";

                    frames["leftFrame"].location.href="Reprots/Left.aspx";
                    frames["mainFrame"].location.href="about:blank";
//                 }
//                else
//                {
//                    showMassgeBox("提示","评估规则没有确定，报表查看！",1,null);
//                    return ;
//                }
                break;
            //新德育项目设置
            case 5:
            document.getElementById("div2").style.marginLeft="200px";
            document.getElementById("div1").style.display="inline";

            frames["leftFrame"].location.href="<%=SiteInfo.GetEvalSiteFront() %>Moral/moralmanage/Left.aspx?UserID=<%=Server.UrlEncode(des.EncryptString(Common.GetUserInfo().UID.ToString()))%>&UserType=<%=perm.UserType %>";
            frames["mainFrame"].location.href="about:blank";
            
            break;
            //新德育评分
            case 6:
            document.getElementById("div2").style.marginLeft="200px";
            document.getElementById("div1").style.display="inline";

            frames["leftFrame"].location.href="<%=SiteInfo.GetEvalSiteFront() %>Moral/moralinput/Left.aspx?UserID=<%=Server.UrlEncode(des.EncryptString(Common.GetUserInfo().UID.ToString()))%>&UserType=<%=perm.UserType %>";
            frames["mainFrame"].location.href="about:blank";
            break;
            //新德育奖项管理
            case 7:
            document.getElementById("div2").style.marginLeft="200px";
            document.getElementById("div1").style.display="inline";

            frames["leftFrame"].location.href="<%=SiteInfo.GetEvalSiteFront() %>Moral/moralawards/Left.aspx?UserID=<%=Server.UrlEncode(des.EncryptString(Common.GetUserInfo().UID.ToString()))%>&UserType=<%=perm.UserType %>";
            frames["mainFrame"].location.href="about:blank";
            break;
            //新德育报表
            case 8:
            document.getElementById("div2").style.marginLeft="200px";
            document.getElementById("div1").style.display="inline";

            frames["leftFrame"].location.href="<%=SiteInfo.GetEvalSiteFront() %>Moral/moralreport/Left.aspx?UserID=<%=Server.UrlEncode(des.EncryptString(Common.GetUserInfo().UID.ToString()))%>&UserType=<%=perm.UserType %>";
            frames["mainFrame"].location.href="about:blank";
            break;
            
        }
        var id = "li"+itemIndex;
		SetStyle(id);
    }

    function SetStyle(id)
    {
		document.getElementById(id).className="avtive";
		var ass = document.getElementById('divTab').getElementsByTagName('a');
        if(ass != null)
        {
            for(var i =0;i < ass.length; i++)
            {
                var li = ass[i];
                if(li.id != id)
                {
                    li.className=""; 
                }
            }
        }
        
    }
    
    
    
     //显示修改密码窗口
    function ShowUpdatePassword()
    {
        document.getElementById('pwd').value='';
        document.getElementById('newpwd1').value='';
        document.getElementById('newpwd2').value='';
        //显示修改密码对话框        
        ShowPopForm("upPwdPop", "upPwdPopTitle", "修改密码");
        //显示背景遮罩
        showMask();
    }
    
    function CloseMask(formId)
    {
        ClosePopForm(formId,true);
        hideMask();
    }
    
    function UpdatePassword()
    {
        var pwd = document.getElementById('pwd');
        var newpwd1 = document.getElementById('newpwd1');
        var newpwd2 = document.getElementById('newpwd2');
        if(pwd.value=="")
        {
        
            showNoticMsg('pwd', '密码不能为空');
            pwd.focus();
            return;
        }
        if(newpwd1.value=="")
        {
            showNoticMsg('newpwd1', '新密码不能为空');
            newpwd1.focus();
            return;
        }
         if(newpwd2.value=="")
        {
            showNoticMsg('newpwd2', '确认密码不能为空');
            newpwd2.focus();
            return;
        }
        
        if (getStringCount(pwd.value) >20)
        {
            showNoticMsg('pwd','密码不能大于20个字符');
            pwd.focus();              
            return;
        }
        
         if (getStringCount(newpwd1.value) >20)
        {
            showNoticMsg('newpwd1','密码不能大于20个字符');
            newpwd1.focus();              
            return;
        }
        
        if (getStringCount(newpwd2.value) >20)
        {
            showNoticMsg('newpwd2','密码不能大于20个字符');
            newpwd2.focus();              
            return;
        }
        
        if (containSpecialChar(pwd.value) == true)
        {
            showNoticMsg('pwd','密码不能含有特殊字符');
            pwd.focus();               
            return;
        }
        
        if (containSpecialChar(newpwd1.value) == true)
        {
            showNoticMsg('newpwd1','密码不能含有特殊字符');
            newpwd1.focus();               
            return;
        }
        
        if (containSpecialChar(newpwd2.value) == true)
        {
            showNoticMsg('newpwd2','密码不能含有特殊字符');
            newpwd2.focus();  
            return;
        }
                                
        
        if(newpwd2.value!=newpwd1.value)
        {
            newpwd1.value = '';
            newpwd2.value = '';
            showNoticMsg('newpwd1','新密码和确认密码必须相同');
            newpwd1.focus();
            return;
        }
        
        PageMethods.UpdatePwd(pwd.value, newpwd1.value, function(result){
            
            if(result > 0)
            {
                showMassgeBox("提示", '修改密码成功');
                ClosePopForm('upPwdPop');
            }
            else if (result == -1)
            {
                pwd.value = '';
                showNoticMsg('pwd','原密码不正确，请重新输入');
                pwd.focus();
            }
            else
            {
                pwd.value = '';
                showNoticMsg('pwd','修改密码失败，请重新修改');
                pwd.focus();
            }

        },function(err){ 
            showMassgeBox("提示",UPDATEPWD_EXCEPTION,1,null);
        });
        
    }
    function Format()
    {
        var c=document.body.scrollHeight;
        if((c-68-50)>0)
        {
            document.getElementById("contentH").style.height=(c-68-50)+"px";
            document.getElementById("leftFrame").style.height=(c-68-50)+"px";
            document.getElementById("mainFrame").style.height=(c-68-50)+"px";
        }
    }
    </script>
</head>
<body onresize="Format()" style="overflow: hidden;" scroll="no">

 <form id="form2" runat="server" style="height:100%">
 <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True">
       </asp:ScriptManager>  
<div class="bodyWarp" oninit="OnInit()" style="height:100%">
    <div class="pageHea" >
    	<div class="navHea" >	
    	
        <table border="0" cellspacing="0" cellpadding="0" style="width:99%;">
            <tr>
                <td rowspan="2" style="padding-top:12px;width:50%;font-family:微软雅黑;"><h2> <%=CommonScore.SchoolName%> 德育评价系统 </h2>
                </td>
                <td style="width:50%;text-align:right;"><img src="../Common/images/top_2.gif" align="absmiddle" style="float:none;" /><a  href="../../main.aspx"  title="">首页</a>&nbsp;&nbsp;<img src="../Common/images/updatepass.gif" align="absmiddle" style="float:none;" /><a href="javascript:ShowUpdatePassword()" title="">修改密码</a>&nbsp;&nbsp;<img src="../Common/images/logout.gif" align="absmiddle" style="float:none;" /><a class="red" href="../../logout.aspx" title="">退出</a>
                </td>
            </tr>
            <tr>
                <td style="text-align:right;">用户：<%= CommonScore.GetUserName %>(<%= CommonScore.GetUserCode %>)&nbsp;&nbsp;&nbsp;<% if (Common.CurrentVersion != EduVersion.School)
                          { %><%=CommonScore.GetAreaName%>/<%=CommonScore.SchoolName%>
                          <% }
                              else
                          {%>
                          <% } %> &nbsp;&nbsp; 当前:<%= GetNowYearAndTerm %>
                </td>
            </tr>
        </table>
        		
        </div>
        <div class="menuHea" id="divTab">
        	<ul>
            	<li  ><a href="javascript:Navigate(1)" id ="li1"  title="">德育表现规则设置</a></li>
               <%-- <li   ><a href="javascript:Navigate(2)" id ="li2" title="">德育日常管理</a></li>--%>
                <li   ><a  href="javascript:Navigate(3)" id ="li3" title="">德育表现评分录入</a></li>
                <li  ><a href="javascript:Navigate(4)" id ="li4"  title="">德育表现报表查询</a></li>
                <%--<li  ><a href="<%=SiteInfo.GetEvalSiteFront() %>Moral/Default.aspx?UserID=<%=Server.UrlEncode(des.EncryptString(Common.GetUserInfo().UID.ToString()))%>&UserType=<%=perm.UserType %>" id ="li5"  title="">班级与班主任德育</a></li>--%>
                <li  ><a href="javascript:Navigate(5)" id ="li5"  title="">项目设置</a></li>
                <li  ><a href="javascript:Navigate(6)" id ="li6"  title="">评分录入</a></li>
                <li  ><a href="javascript:Navigate(7)" id ="li7"  title="">奖项管理</a></li>
                <li  ><a href="javascript:Navigate(8)" id ="li8"  title="">报表查询</a></li>
                
            </ul>
            <span id="txtOpenExam"></span>
        </div>

   </div>

	<div class="pageBody" id="contentH" >

       <div class="pageLeft"  id="div1">
        	<iframe name="leftFrame" src="about:blank" style="height:100%; width:100%; overflow:auto;" frameborder="0"  marginwidth="0" marginheight="0" scrolling="No" ></iframe>
       </div>
       
       <div class="pageMain" id="div2">
            <iframe name="mainFrame" src="../Welcome.htm" style="height:100%;width:100%" frameborder="0" border="0" marginwidth="0" marginheight="0" ></iframe>
       </div>
     
    </div>

	<div class="pageFoot">
    	<a href="http://www.juwangtech.com/" title="武汉聚网科技有限公司">武汉聚网科技有限公司</a> 版权所有 @2009  全国免费服务热线：800-713-6688 电子邮箱：service@juwangtech.com
    </div>
    
    
    <!--END-->
</div>
</form>
 <div id="upPwdPop" class="layoutWarp" style="display: none; width:400px;">
        <div class="title">
	        <span id="upPwdPopTitle"></span>
            <a title="关闭" onclick="return ClosePopForm('upPwdPop')">关闭</a>
          </div>
    <table border="0" class="layoutTable">
        <tr>
            <td width="107" align="right">原密码：</td>
            <td width="213" align="left"><INPUT onkeydown="" id="pwd" class="textInput" onfocus="" maxlength="20" type=password /></td>
        </tr>
        <tr>
            <td width="107" align="right">新密码：</td>
            <td width="213" align="left"><INPUT onkeydown="" id="newpwd1" class="textInput" onfocus="" maxlength="20" type=password /></td>
        </tr>
        <tr>
            <td width="107" align="right">确认新密码：</td>
            <td width="213" align="left"><INPUT onkeydown="" id="newpwd2" class="textInput" onfocus="" maxlength="20" type=password /></td>
        </tr>
        <tr>
            <td colspan ="2">
            <div align="center">
            <input name="btnReqClsOK" type="button" class="commonBut" id="btnReqClsOK" onclick="UpdatePassword();" value="确定" />
            <input name="btnReqClsCancel" type="button" class="commonBut" id="btnReqClsCancel"  onclick="return CloseMask('upPwdPop')" value="取消" />
            </div></td>
        </tr>
    </table>
    </div>

</body>
</html>
    <script type="text/javascript">  
        document.getElementById("div1").style.display="none";
        document.getElementById("div2").style.marginLeft="5px";
        frames["leftFrame"].location.href="about:blank";     
        Format();
        
        <% GetStartInfor();
           Response.Write(" canUseManage ="+ (canUseManage? "true": "false") +";");
          %>;
        Navigate(3);
//        canUseManage = <%= canUseManage? "true": "false" %>;

//        canUseInput = <%= canUseInput? "true": "false" %>;

//        canStart = <%= canStart? "true": "false" %>;
//        if(startindex>0)
//        {
//            Navigate(startindex);
//        }
    </script>